<?php

error_reporting(0);

require_once("phpmailer/class.phpmailer.php");

class helper_phpmailer
{

    public function send_email($recipient, $subject, $message)
    {

        $mail = new PHPMailer();
        $body = $message;
        $mail->IsSMTP();

        $mail->Host = "ssl://smtp.googlemail.com";
        $mail->Port = "465";
        $mail->SMTPAuth = true;
        $mail->Username = "fatangel26@gmail.com";
        $mail->Password = "demthoigian";
        $mail->From = "fatangel26@gmail.com";
        $mail->FromName = "Nguyễn Bảo Trung";
        $mail->From = "fatangel26@gmail.com";
        $mail->Subject = $subject;
        $mail->AddReplyTo("fatangel26@gmail.com","Nguyễn Bảo Trung");
        $mail->AltBody = strip_tags($message);
        $mail->MsgHTML($body);
        $mail->CharSet = "utf-8";
        $mail->AddAddress($recipient);

        if (!$mail->Send())
        {
            return FALSE;
            //echo $mail->ErrorInfo;
        }
        else
        {
            return TRUE;
        }
    }
}